package com.glory.cqaospda.view

import android.annotation.SuppressLint
import android.content.Intent
import android.os.Bundle
import android.view.KeyEvent
import com.glory.cqaospda.R
import com.glory.cqaospda.viewmodel.EndjobModel
import com.glory.mvvmnet.base.BaseActivity
import com.pda.platform.ui.ui_pdaplatform.utils_public.FreeApi_ActivityManager

class EndjobActivity: BaseActivity<EndjobModel>() {
    override fun initData() {

    }

    override fun initView(savedInstanceState: Bundle?) {

        FreeApi_ActivityManager.getActivityManager().addActivity(this)
    }

    override fun layoutId(): Int {
        return R.layout.activity_endjob
    }
    @SuppressLint("SetTextI18n")
    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)

        if (requestCode == 1) {
            when (resultCode) {
                108 -> {
                    finish()
                }
            }
        }
    }
    override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean {
        if (keyCode == KeyEvent.KEYCODE_BACK){
            intent.putExtra("type", "KeyEvent")
            intent.setClass(this, SkipDialogActivity::class.java)
            startActivityForResult(intent, 1)
            return false
        }
        return super.onKeyUp(keyCode, event)
    }
}